define(['app'], function(app) {
	'use strict';

	var controller = function controller($scope, Refundtenderdetail,$stateParams) {
		$scope.order_id = $stateParams.order_id;
		var status = new Array();
//		Refundtenderdetail.get_refundtenderdetail(function(data){
//			$scope.refundtenderdetail = data;
//			
//		});
		$scope.init_status = function() {
			status = new Array(17);
			status[0] = "";
			status[1] = "退款协议等待卖家确认";
			status[2] = "审核中";
			status[3] = "同意退款";
			status[4] = "完成";
			status[5] = "拒绝";
			status[6] = "已收货";
			status[7] = "已质检";
			status[8] = "补差价";
			status[9] = "已拒绝退款";
			status[10] = "已取消";
			status[11] = "卖家不同意协议，等待买家修改";
			status[12] = "买家已退货，等待卖家确认收货";
			status[13] = "已修改";
			status[14] = "卖家收到退货，拒绝退款";
			status[15] = "卖家同意退款，等待卖家打款至平台";
			status[16] = "卖家已退款，等待系统结算";
		}
		$scope.init_data = function(){
			$scope.init_status();
			Refundtenderdetail.return_detail($scope.order_id,function(data){
				$scope.datas = data;
				$scope.datas.statu = status[$scope.datas.status];
			})
		}
		$scope.init_data();
        
	}

	controller.$inject = ['$scope', 'Refundtenderdetail','$stateParams'];
	
	return app.registerController("refundtenderdetailctrl",controller);
});